Optimal. Leaf size=36 \[ -\frac{\log \left (a \cos ^2(e+f x)+b \sin ^2(e+f x)\right )}{2 f (a-b)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0530929, antiderivative size = 36, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.19, Rules used = {3670, 444, 36, 31} \[ -\frac{\log \left (a \cos ^2(e+f x)+b \sin ^2(e+f x)\right )}{2 f (a-b)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3670
Rule 444
Rule 36
Rule 31
Rubi steps
\begin{align*} \int \frac{\tan (e+f x)}{a+b \tan ^2(e+f x)} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{x}{\left (1+x^2\right ) \left (a+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \frac{1}{(1+x) (a+b x)} \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac{\operatorname{Subst}\left (\int \frac{1}{1+x} \, dx,x,\tan ^2(e+f x)\right )}{2 (a-b) f}-\frac{b \operatorname{Subst}\left (\int \frac{1}{a+b x} \, dx,x,\tan ^2(e+f x)\right )}{2 (a-b) f}\\ &=-\frac{\log (\cos (e+f x))}{(a-b) f}-\frac{\log \left (a+b \tan ^2(e+f x)\right )}{2 (a-b) f}\\ \end{align*}
Mathematica [A] time = 0.0283086, size = 37, normalized size = 1.03 \[ -\frac{\log \left (a+b \tan ^2(e+f x)\right )+2 \log (\cos (e+f x))}{2 f (a-b)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.014, size = 50, normalized size = 1.4 \begin{align*} -{\frac{\ln \left ( a+b \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) }{2\,f \left ( a-b \right ) }}+{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) }{2\,f \left ( a-b \right ) }} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.05478, size = 41, normalized size = 1.14 \begin{align*} -\frac{\log \left (-{\left (a - b\right )} \sin \left (f x + e\right )^{2} + a\right )}{2 \,{\left (a - b\right )} f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.08921, size = 90, normalized size = 2.5 \begin{align*} -\frac{\log \left (\frac{b \tan \left (f x + e\right )^{2} + a}{\tan \left (f x + e\right )^{2} + 1}\right )}{2 \,{\left (a - b\right )} f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 3.34803, size = 143, normalized size = 3.97 \begin{align*} \begin{cases} \frac{\tilde{\infty } x}{\tan{\left (e \right )}} & \text{for}\: a = 0 \wedge b = 0 \wedge f = 0 \\- \frac{1}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} & \text{for}\: a = b \\\frac{x \tan{\left (e \right )}}{a + b \tan ^{2}{\left (e \right )}} & \text{for}\: f = 0 \\\frac{\log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 a f} & \text{for}\: b = 0 \\- \frac{\log{\left (- i \sqrt{a} \sqrt{\frac{1}{b}} + \tan{\left (e + f x \right )} \right )}}{2 a f - 2 b f} - \frac{\log{\left (i \sqrt{a} \sqrt{\frac{1}{b}} + \tan{\left (e + f x \right )} \right )}}{2 a f - 2 b f} + \frac{\log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 a f - 2 b f} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.48737, size = 72, normalized size = 2. \begin{align*} \frac{\frac{2 \, \log \left (2\right )}{a - b} - \frac{\log \left ({\left | a \cos \left (f x + e\right )^{2} - b \cos \left (f x + e\right )^{2} + b \right |}\right )}{a - b}}{2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]